package com.kingyun.gpsinspection.purificationservice.common.enums;

/**
 * Created by yangcs on 2017/3/2.
 */
public enum OrderStatusEnum {
    WORK_ORDER_STATUS_ENUM_0(0,"待处理"),
    WORK_ORDER_STATUS_ENUM_1(1,"作业条件准备"),
    WORK_ORDER_STATUS_ENUM_2(2,"作业条件确认"),
    WORK_ORDER_STATUS_ENUM_3(3,"关键操作申请"),
    WORK_ORDER_STATUS_ENUM_4(4,"申请通过"),
    WORK_ORDER_STATUS_ENUM_5(5,"申请不通过"),
    WORK_ORDER_STATUS_ENUM_6(6,"已完成"),
    WORK_ORDER_STATUS_ENUM_7(7,"已关闭"),
    WORK_ORDER_STATUS_ENUM_8(-1,"预处理"),
    ;
    OrderStatusEnum(Integer code, String description){
        this.code=code;
        this.decription=description;
    }

    private Integer code;
    private String decription;

    public Integer code (){
        return code;
    }

    public  String description(){
        return decription;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDecription() {
        return decription;
    }

    public void setDecription(String decription) {
        this.decription = decription;
    }

    public static String getDescription(int code) {
        for (OrderStatusEnum orderStatusEnum : OrderStatusEnum.values()) {
            if (orderStatusEnum.getCode() == code) {
                return orderStatusEnum.getDecription();
            }
        }
        return null;
    }

}
